package com.tledu.equipment.service.impl;

import com.tledu.common.utils.DateUtils;
import com.tledu.equipment.domain.EquipmentUse;
import com.tledu.equipment.domain.vo.EquipmentUseVO;
import com.tledu.equipment.mapper.EquipmentUseMapper;
import com.tledu.equipment.service.IEquipmentUseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备使用记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-29
 */
@Service
public class EquipmentUseServiceImpl implements IEquipmentUseService 
{
    @Autowired
    private EquipmentUseMapper equipmentUseMapper;

    /**
     * 查询设备使用记录
     * 
     * @param id 设备使用记录主键
     * @return 设备使用记录
     */
    @Override
    public EquipmentUse selectEquipmentUseById(Long id)
    {
        return equipmentUseMapper.selectEquipmentUseById(id);
    }

    /**
     * 查询设备使用记录列表
     * 
     * @param equipmentUse 设备使用记录
     * @return 设备使用记录
     */
    @Override
    public List<EquipmentUseVO> selectEquipmentUseList(EquipmentUse equipmentUse)
    {
        return equipmentUseMapper.selectEquipmentUseList(equipmentUse);
    }

    /**
     * 新增设备使用记录
     * 
     * @param equipmentUse 设备使用记录
     * @return 结果
     */
    @Override
    public int insertEquipmentUse(EquipmentUse equipmentUse)
    {
        equipmentUse.setCreateTime(DateUtils.getNowDate());
        return equipmentUseMapper.insertEquipmentUse(equipmentUse);
    }

    /**
     * 修改设备使用记录
     * 
     * @param equipmentUse 设备使用记录
     * @return 结果
     */
    @Override
    public int updateEquipmentUse(EquipmentUse equipmentUse)
    {
        return equipmentUseMapper.updateEquipmentUse(equipmentUse);
    }

    /**
     * 批量删除设备使用记录
     * 
     * @param ids 需要删除的设备使用记录主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentUseByIds(Long[] ids)
    {
        return equipmentUseMapper.deleteEquipmentUseByIds(ids);
    }

    /**
     * 删除设备使用记录信息
     * 
     * @param id 设备使用记录主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentUseById(Long id)
    {
        return equipmentUseMapper.deleteEquipmentUseById(id);
    }
}
